const connectionPoll = require("../app/mysql");

class labelController
{
    async create(ctx,next)
    {
        let { name, id } = ctx.request.body;
        
        //使用mysql2插入数据
        const statement = "insert into t_label(name,id) values(?,?)"
        connectionPoll.promise().execute(statement, [name, id]);
        ctx.body = {
            code: 0,
            message:"插入label成功"
        }
        await next();
    }
}

module.exports = new labelController();